package day02;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

public class DataTypeDemo {
    public static void main(String[] args) {
        //练习
        //1)
        int a1;
        int a2,a3,a4;
        int a5 = 6;
        int g = 8;
        int h = g + 10;
        System.out.println(h);
        g = g + 10;
        System.out.println(g);
        //int 1a;//不能亿数字为开头
        //int *a1;//不能包含*号等特殊符号
        //int class;//不能包含关键字

        //2)
        int b1 = 50, b2 = 3;
        System.out.println(b1/b2);
        int b3 = 2000000000, b4 = 1000000000;
        System.out.println(b3+b4);

        //3)
        long c1 = 199999999999L, c2 = 199819992000L;
        long c3 = 1000000000, c4 = 50000000;
        long c5 = 2000000000L * 2+19999999;
        System.out.println(c5);

        //4)
        double d1 = 3.14, d2 = 3.1415926;
        double d3 = 3.0, d4 = 2.9;
        double d5 = d3 - d4;
        System.out.println(d5);

        //5)
        boolean e1 = true, e2 =false;

        //6)
        char f1 = '男';
        char f2 = '1';
        char f3 = '$';
        char f4 = 'z';
        char f5 = '#';
        char f6 = 998;
        System.out.println(f6);

        //7)
        int w1 = 99;
        double w2 = w1;
        long w3 = 99999L;
        int w4 =(int)w3;
        long w5 = 3000000000L;
        int w6 = (int)w5;
        System.out.println(w6);

        //8)





















      /*
        //1)
        int a = 66;
        int b = 10, c = 20, d = 30;
        int g = 11;
        int h = g + 10;
        System.out.println(h);
        g = g + 10;
        System.out.println(g);
        //int 1y = 999;不能以数字开头

        //2)
        int aa = 99, bb = 88;
        System.out.println(aa/bb);
        int cc = 1999999999, dd = 500000000;
        System.out.println(cc+dd);

        //3)
        long a1 = 9898L, a2 = 9999L;
        long a3 = 1000000000000000000L;
        long a4 = 100000000000L*9*10;
        System.out.println(a4);

        //4)
        double b1 = 3.14, b2 = 3.1415;
        double b3 = 4.0, b4 = 3.9;
        System.out.println(b3-b4);

        //5)
        boolean c1 = true;
        boolean c2 = false;
        //boolean c3 = 25;//编译错误,布尔型只能赋值为true或false

        //6)
        char d1 = '男';
        char d2 = 'g';
        char d3 = '$';
        char d4 = '9';
        char d5 = '\\';
        System.out.println(d5);

        //7)
        int e1 = 50;
        double e2 = e1;
        short e3 = (short) e1;
        long e4 = 90000000000L;
        int e5 = (int)e4;
        System.out.println(e5);
        double e6 = 3.1415926;
        int e7 = (int)e6;
        System.out.println(e7);

        //8)
        byte f1 = 10, f2 = 12;
       */














        /*
        byte ba = 5;
        byte bb = 6;
        byte bc = (byte)(ba+bb);
        System.out.println(bc);


        System.out.println(2+2);
        System.out.println(2+'2');
        System.out.println('2'+'2');
        int a = '你';
        int b = '是';
        int c = '笨';
        int d = '蛋';
        int e = '吗';
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);
        System.out.println(e);
        char f = 20320;
        char g = 26159;
        char h = 31528;
        char j = 34507;
        char k = 21527;
        System.out.print(f);
        System.out.print(g);
        System.out.print(h);
        System.out.print(j);
        System.out.print(k);
         */






        //类型转换
        /*
        //1)
        int a =1000;
        long b = a ;//自动类型转换
        long c = 100000;
        int d = (int)c;//强制类型转换
        System.out.println(c);
        double e = 33.333;
        int f = (int)e;//强制类型转换
        System.out.println(f);
        double j = 444.444;
        long h = (long)j;//强制类型转换
        System.out.println(h);
        int i = 998;
        double g = i;//自动类型转换
        System.out.println(g);
         */










        /*
        //5)char:字符型.2个字节
        char a1 = '男';//字符男
        char a2 = 'n';//字符n
        char a3 = '1';//字符1
        char a4 = 71;//0到65535之间
        System.out.println(a4);
        char a5 = '\\';
        System.out.println(a5);

         */







        /*

        //4)boolean:布尔型,1个字节
        boolean a = true;//true为布尔型直接量
        boolean b = false;//false为布尔型直接量
        //boolean c = 25;//编译错误,布尔型只能存储true或false


         */




        /*
        //3)double:浮点型,8个字节,很大很大不用在乎
        double a = 25.678;//25.678为小数直接量,默认为double类型
        float b = 25.678F;//25.678F为float直接量

        double c=3.0,d=2.9;
        System.out.println(c-d);//0.10000000000000009,发生舍入误差


         */











        /*
        //2)long:长整型,8个字节,-900万万亿到900万万亿
        long a = 25L;
        //long b = 10000000000;编译错误100亿默认为int类型,但超出int范围
        long c = 10000000000L;
        long d = 365L*24*60*60*1000;//去年一年经历的毫秒数
        System.out.println(d);

        long e = 1000000000*2*10L;
        System.out.println(e);
        long f = 1000000000*3*10L;
        System.out.println(f);
        long g = 1000000000L*3*10;
        System.out.println(g);
         */




        /*
        //1)int:整形,4个字节,-21亿到21亿
        int look = 4090;
        //int looker = 3.4;编译错误,整型变量中只能装整数
         */
    }
}
